<template>
  <div class="aside-box">
    <ul>
      <li>
        <router-link to="/musichome/findmusic" tag="span">
          <span class="iconfont icon-find-music">发现音乐</span>
        </router-link>
      </li>
      <li>
        <router-link to="/musichome/playlist" tag="span">
          <span class="iconfont icon-music-list">推荐歌单</span>
        </router-link>
      </li>
      <li>
        <router-link to="/musichome/newmusic" tag="span">
          <span class="iconfont icon-music">最新音乐</span>
        </router-link>
      </li>
      <li>
        <router-link to="/musichome/musicvideo" tag="span">
          <span class="iconfont icon-mv">最新MV</span>
        </router-link>
      </li>
      <li>
        <router-link to="/musichome/search" tag="span">
          <span class="el-icon-search">搜索音乐</span>
        </router-link>
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  data() {
    return {
      path: "/",
    }
  },
  watch: {
    $route: {
      handler(val, oldval) {
        this.path = val.path
      },
      // 深度观察监听
      deep: true,
    },
  },
}
</script>
<style lang="scss" scoped>
$primary: #409eff;
.aside-box {
  width: 100%;
  height: 100%;
  background: rgb(248, 248, 248);
  .list {
    height: calc(100% - 115px);
    overflow-y: auto;
    border-top: 1px solid #ccc;
    box-sizing: border-box;
    padding-bottom: 10px;
    .title {
      padding-left: 10px;
      height: 40px;
      line-height: 40px;
      text-align: left;
      margin: 0;
      font-size: 16px;
    }
    ul {
      li {
        padding-left: 30px;
        box-sizing: border-box;
        height: 32px;
        line-height: 32px;
        list-style: none;
        text-align: left;
        transition: 0.5s;
        span {
          display: inline-block;
          width: 100%;
        }
        i {
          font-size: 14px;
          padding-right: 4px;
          font-style: normal;
        }
      }
      li:hover {
        cursor: pointer;
        background: $primary;
        color: white;
      }
    }
  }
}
::-webkit-scrollbar {
  height: 0;
  width: 0;
  color: transparent;
}
.path_active {
  background: $primary;
  color: white;
}
.router-link-active {
  // color: #dd6d60;
  color: white;
}
</style>
